//具名分组
let str = '2023-05-15 12:13:14';
let regexp  = /(\d{4})-(\d{1,2})-(\d{1,2}) (?<hour>\d{1,2}):(\d{1,2}):(\d{1,2})/;
let result = regexp.exec(str);
console.log(result);
console.log(result.groups.hour);


function Person(name){
  this.name = name;
}
Person.prototype.setName = function(newName){
    console.log(newName);
    Person.$1 = newName;
}

let person = new Person('zhangsan');
let person2 = new Person('zhangsan2');
person.setName('lisi');
console.log(Person.$1);
person2.setName('lisi2');
console.log(Person.$1);
